﻿package cgs.server.logging.messages
{
    import cgs.server.logging.*;

    dynamic public class QuestMessage extends Message implements IQuestMessage
    {
        private var _questID:String;
        private var _dynamicQuestID:String;
        private var _questDetail:Object;

        public function QuestMessage(param1:int, param2:Object, param3:Boolean, param4:String = null, param5:String = null, param6:GameServerData = null)
        {
            super(param6);
            this.setQuestID(param1);
            this._questDetail = param2;
            addProperty("q_detail", this._questDetail);
            addProperty("q_s_id", param3 ? (1) : (0));
            if (param4 != null)
            {
                addProperty("ae_seq_id", param4);
            }
            if (param5 != null)
            {
                this.setDQID(param5);
            }
            return;
        }// end function

        public function setQuestID(param1:int) : void
        {
            this._questID = "" + param1;
            addProperty("qid", this._questID);
            return;
        }// end function

        public function getQuestID() : int
        {
            return _messageObject.qid;
        }// end function

        public function setDQID(param1:String) : void
        {
            this._dynamicQuestID = param1;
            addProperty("dqid", this.dqid);
            return;
        }// end function

        public function get dqid() : String
        {
            return this._dynamicQuestID;
        }// end function

        public function get isDQIDValid() : Boolean
        {
            return this._dynamicQuestID != null;
        }// end function

        public function get qid() : String
        {
            return this._questID;
        }// end function

        public function get q_detail() : Object
        {
            return this._questDetail;
        }// end function

        override public function injectParams() : void
        {
            super.injectParams();
            injectLevelID(true);
            injectTypeID(true);
            injectSessionID(false);
            return;
        }// end function

    }
}
